<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="util.*,bean.*,databaseDAO.*,java.util.*"%>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在此处插入标题</title>
</head>
<body>

	<%
	
		UserBean CurrentUser = (UserBean)session.getAttribute("user");
	    RoleManagement rm = new RoleManagement();
		List<RoleBean> list = rm.queryRoles();
		Iterator<RoleBean>it = list.iterator();
		RoleBean rb = null;
		
		
		if(CurrentUser.getUserID().equals("1")){
			UserBean ub = (UserBean)session.getAttribute("userByModify");
	%>
<form name="form" method="post" action="/RightManagementSystem/LoginServlet?a=goToUpdate">
	   <table width="100%">
		     <tbody>
			     <tr>
				    <td height="10">
					<div class="table_t">
							<a href="javascript:history.back()"><<< 返回</a>
						</div>
					</td>
				</tr>
			</tbody>
		</table>	

		<table class="mars" cellspacing="1" cellpadding="0"
			width="100%" border="0">
			<tbody>
				<tr>
					<td height="10" colspan="4">
						<input name="uid" type="hidden" value="<%=ub.getUserID()%>">
					</td>
				</tr>

				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							昵称:
						</div>
					</td>
					<td width="122">
						<input name="nickName" type="text"
							value="<%=ub.getNickName()%>"/>
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户名:
						</div>
					</td>
					<td width="163" height="15">
						<input name="userName" type="text"
							value="<%=ub.getUserName()%>" />
					</td>
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							密码:
						</div>
					</td>
					<td width="122">
						<input name="password" readonly="readonly" type="password"
							value="<%=ub.getPassword()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户角色:
						</div>
					</td>
					<td width="163" height="15">
					<select  name="userRole" id="userRole" >
					
						<%
						while(it.hasNext()){
							rb = it.next();
							%>
							<%if(ub.getRoleID().equals(rb.getRoleID())){ %>
						<OPTION  selected='selected' value='<%=rb.getRoleID()%>'><%=rb.getRoleName() %></OPTION>
						<%}else{ %>
							<OPTION  value='<%=rb.getRoleID()%>'><%=rb.getRoleName() %></OPTION>
						<%} }%>
						</select>
					</td>
				</tr>

				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							用户创建时间:
						</div>
					</td>
					<td width="122">
						<input name="userCreateTime" readonly="readonly" type="text"
							value="<%=ub.getUserCreateTime()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户登录时间:
						</div>
					</td>
					<td height="15" class="table_c">
						<input type="text" name="loginTime" readonly="readonly" value="<%=ub.getLoginTime() %>" />
					</td>	
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							用户登录时长:
						</div>
					</td>
					<td width="122">
						<input name="loginTimeLong" readonly="readonly" type="text"
							value="<%=ub.getLoginTimeLong()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户当前状态:
						</div>
					</td>
					<td width="163" height="15">
						<input name="currentStatus" readonly="readonly" type="text"
							value="<%=ub.getCurrentStatus()%>" />
					</td>
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							IP:
						</div>
					</td>
					<td width="122">
						<input name="IP" readonly="readonly"
							value="<%=ub.getIP()%>" type="text" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户描述:
						</div>
					</td>
					<td width="163" height="15">
						<%
							if (ub.getUserDescription() == null) {
						%>
						<input name="userDescription" type="text" value="" />
						<%
							} else {
						%>
						<input name="userDescription" id="" type="text"
							value="<%=ub.getUserDescription()%>" />
						<%
							}
							
						%>
					</td>
				</tr>
				
				<% }else{
					
					UserBean ub = CurrentUser;
				%>
				
				
				<!-- </tbody>
				<table width="100%">
		</table>	 -->

		<table class="mars" cellspacing="1" cellpadding="0"
			width="100%" border="0">
			<tbody>
				<tr>
					<td height="10" colspan="4">
						<input name="uid" type="hidden" value="<%=ub.getUserID()%>">
					</td>
				</tr>

				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							昵称:
						</div>
					</td>
					<td width="122">
						<input name="nickName" type="text"
							value="<%=ub.getNickName()%>"/>
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户名:
						</div>
					</td>
					<td width="163" height="15">
						<input name="userName" readonly="readonly" type="text"
							value="<%=ub.getUserName()%>" />
					</td>
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							密码:
						</div>
					</td>
					<td width="122">
						<input name="password" readonly="readonly" type="password"
							value="<%=ub.getPassword()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户角色:
						</div>
					</td>
					<td width="163" height="15">
					<select  name="userRole" readonly="readonly" id="userRole" >
					
						<%
						while(it.hasNext()){
							rb = it.next();
							%>
							<%if(ub.getRoleID().equals(rb.getRoleID())){ %>
						<OPTION  selected='selected' value='<%=rb.getRoleID()%>'><%=rb.getRoleName() %></OPTION>
						<%}%>
						<% }%>
						</select>
					</td>
				</tr>

				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							用户创建时间:
						</div>
					</td>
					<td width="122">
						<input name="userCreateTime" readonly="readonly" type="text"
							value="<%=ub.getUserCreateTime()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户登录时间:
						</div>
					</td>
					<td height="15" class="table_c">
						<input type="text" name="loginTime" readonly="readonly" value="<%=ub.getLoginTime() %>" />
					</td>	
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							用户登录时长:
						</div>
					</td>
					<td width="122">
						<input name="loginTimeLong" readonly="readonly" type="text"
							value="<%=ub.getLoginTimeLong()%>" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户当前状态:
						</div>
					</td>
					<td width="163" height="15">
						<input name="currentStatus" readonly="readonly" type="text"
							value="<%=ub.getCurrentStatus()%>" />
					</td>
				</tr>
				<tr>
					<td width="122" height="15" class="table_c">
						<div align="right">
							IP:
						</div>
					</td>
					<td width="122">
						<input name="IP" readonly="readonly"
							value="<%=ub.getIP()%>" type="text" />
					</td>
					<td width="85" class="table_c">
						<div align="right">
							用户描述:
						</div>
					</td>
					<td width="163" height="15">
						<%
							if (ub.getUserDescription() == null) {
						%>
						<input name="note" type="text" value="" />
						<%
							} else {
						%>
						<input name="note" id="" type="text"
							value="<%=ub.getUserDescription()%>" />
						<%
							}
							
						%>
					</td>
				</tr>
				
				
				
				
				
				
				
				
				
				<%} %>
				
				<tr>
					<td height="15" colspan="4">
						<div align="center">
							<div class="loading_ll">
								<input type="image" src="../images/update1.gif"  border="0" alt="修改" />
							</div>
						</div>
					</td>
				</tr>

			</tbody>
		</table>
</form>


</body>
</html>